-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Parametric schedules error when profiles not matched #1775
Conversation
@@ -555,6 +564,8 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins | |||
# skip if rules already match | |||
if (sch_ruleset_days_used[sch_index] - day_group).empty? | |||
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.Parametric.Schedules', "in #{__method__}: #{schedule_ruleset.name} rule #{sch_index} already matches hours of operation rule #{hoo_index}; new rule won't be created.") | |||
# iterate new_rule_ct anyway to keep these rules | |||
new_rule_ct += 1 unless sch_index == -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iterating this counter when rules already match an hours_of_operation rule (except when it's the default profile) means those rules won't inadvertently be removed below.
props.setFeature('param_sch_ver', '0.0.1') # this is needed to see if formulas are in sync with version of standards that processes them also used to flag schedule as parametric | ||
props.setFeature('param_sch_floor', min_max['min']) | ||
props.setFeature('param_sch_ceiling', min_max['max']) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just avoids the same schedule (applied to different space load instances) being 'set up' multiple times
schedule_ruleset.scheduleRules[new_rule_ct..-1].each(&:remove) unless new_rule_ct == 0 | ||
if !(new_rule_ct == 0 || new_rule_ct == schedule_ruleset.scheduleRules.size) | ||
schedule_ruleset.scheduleRules[new_rule_ct..-1].each(&:remove) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cleans up old rules that don't match hours_of_operation rules.
if stat_file.monthly_undis_ground_temps_4p0m.empty? | ||
return false | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid trying to set data that doesn't exist
Pull request overview
@mdahlhausen reported that some ComStock workflows were failing with errors such as:
This was due to some already-matched ScheduleRules were being removed after new ScheduleRules (matched with building hours of operation ScheduleRules) were created. This PR fixes the issue.
It also includes some minor modification to the StatFile class to catch cases (such as in ComStock) where weather .stat files do not contain undisturbed ground temperatures, and does not try to set the missing info.
Pull Request Author
bundle exec rake doc
)bundle exec rake rubocop
)Review Checklist
This will not be exhaustively relevant to every PR.